Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

(PoC) Swagger spec in comments #1497

Closed
wants to merge 1 commit into from

Conversation

kindermoumoute
Copy link
Contributor

Use Swagger to generate API documentation and client

Date Open: 01/26/2017
Date To Close: 02/03/2017
Required Participants: @candysmurf @jcooklin @IRCody

Summary: Swagger is a tool that allows to create client, server and documentation for APIs from a single specification file. This specification file can also be generated from comments in the code.
Proposal: Generate Swagger specification from the code in order to generate clients and documentation for Snap API.

  • In Scope:
    Write Swagger comments in the code to generate a proper specification file
    Generate API documentation from specification file
    Create Go client from specification file
  • Out of Scope:
    Create API server from specification file.

PoC

Summary of changes:

  • Add Swagger comments for getPlugin and getPlugins
  • Add swagger.json

Testing done:

  • verify swagger.json respects standard
  • generate spec from comments
  • compare generated spec with swagger.json (should be the same)

@kindermoumoute
Copy link
Contributor Author

kindermoumoute commented Jan 27, 2017

This enables to use swagger tooling around swagger.json spec file.

e.g. go on pet store and explore the url https://raw.githubusercontent.com/kindermoumoute/snap/swagger/mgmt/rest/v2/swagger.json

- Add Swagger comments
- Add test to verify swagger comments respect standard
@candysmurf
Copy link
Contributor

@kindermoumoute, Well done POC. Great work! We'll incorporate your ideas into our future work! thanks.

@candysmurf candysmurf closed this Feb 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants